package edu.sctu.renpingan.ioflow.ioflowinputstram;

import java.io.*;

/**
 * Created by Administrator on 2015/6/14.
 */
public class IoFlowInputStream {
    FileInputStream fileInputStream;
    FileOutputStream fileOutputStream;
    byte[] bytes = new byte[1024];
    public void getIoflow(){
        int betye = 0;
        int count = 0;
        try {
             fileInputStream = new FileInputStream(new File("D://我的资料//一班活动//party.mp4"));
            fileOutputStream = new FileOutputStream(new File("H://party1.mp4"));
            try {
                while((betye = fileInputStream.read(bytes)) != -1){

                    fileOutputStream.write(bytes,0,betye);
                    count +=betye;
                }
                System.out.println(count);
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                fileInputStream.close();
                fileOutputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
